import {request} from "../../request";
export function addShare(data,method) {
    return request({
        url: '/share',
        method: method,
        data: data,
        headers: {
            "Content-Type":"application/json"
        },
    })
}

export function getAllShare(){
    return request({
        url: '/share/getAll/' +  window.sessionStorage.getItem("username"),
        method: 'get'
    })
}

export function getHotShare(){
    return request({
        url: '/share/hotShares',
        method: 'get'
    })
}
export function getCollection(type){
    return request({
        url: '/collection?username=' +  window.sessionStorage.getItem("username") + "&type=" + type,
        method: 'get'
    })
}

export function addCollection(data,method) {
    return request({
        url: '/collection',
        method: method,
        data: data,
        headers: {
            "Content-Type":"application/json"
        },
    })
}

export function like(data,method) {
    return request({
        url: '/shareLike',
        method: method,
        data: data,
        headers: {
            "Content-Type":"application/json"
        },
    })
}
